package com.guomao.entity;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//@Data
//@AllArgsConstructor
//@NoArgsConstructor
public class Car implements Comparable<Car> {

    private String color;
    private String brand;

    @Override
    public int compareTo(Car o) {
        return brand.compareTo(o.getBrand());
    }

    public Car(String color, String brand) {
        this.color = color;
        this.brand = brand;
        System.out.println("Car hava args constructor");
    }

    public Car() {
        System.out.println("Car no args constructor");
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    @Override
    public String toString() {
        return "Car{" +
                "color='" + color + '\'' +
                ", brand='" + brand + '\'' +
                '}';
    }
}
